Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stylis-rule-sheet

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylis-rule-sheet

stylis plugin to extract individual rules to use with insertRule API

  • 0.0.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is stylis-rule-sheet?

The stylis-rule-sheet npm package is a plugin for Stylis, a lightweight CSS preprocessor. It allows you to handle CSS rules in a more programmatic way, making it easier to manipulate and inject styles dynamically.

What are stylis-rule-sheet's main functionalities?

Injecting CSS Rules

This feature allows you to inject CSS rules dynamically. The `ruleSheet` function takes a callback that will be called with each CSS rule, allowing you to handle it as needed.

const stylis = require('stylis');
const ruleSheet = require('stylis-rule-sheet');

const insertRule = ruleSheet((rule) => {
  console.log(rule); // This will log the CSS rule
});

stylis.use(insertRule);
stylis('.class', 'color: red;');

Handling Nested Rules

This feature allows you to handle nested CSS rules. The `ruleSheet` function will be called with each nested rule, making it easier to manage complex styles.

const stylis = require('stylis');
const ruleSheet = require('stylis-rule-sheet');

const insertRule = ruleSheet((rule) => {
  console.log(rule); // This will log the nested CSS rule
});

stylis.use(insertRule);
stylis('.parent', '.child { color: blue; }');

Other packages similar to stylis-rule-sheet

Keywords

FAQs

Package last updated on 08 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc